#ifndef CONFIGFORM_H
#define CONFIGFORM_H

#include <QWidget>
#include <QSerialPort>
#include "../head/mBPSK_Demodulator/BPSK_Demodulator.h"


namespace Ui {
class ConfigForm;
}
Q_DECLARE_METATYPE(FIFO_Receiver);


class ConfigForm : public QWidget
{
    Q_OBJECT

public:
    explicit ConfigForm(QWidget *parent = nullptr);
    ~ConfigForm();
    void closeEvent(QCloseEvent *e);
private slots: 
    void on_connectButton_clicked();
    void on_connectButton_2_clicked();
    void on_connectButton_4_clicked();
    void on_connected(const int port);
    void on_recvData(const QString & str);
    void on_clientError(const QString & erro);

signals:
    void sendStatusMessage(QString comInfo,int hzType);
    void connectHost(const QString& host, const int port);
private:
    Ui::ConfigForm *ui;  
    void writeComPort(QString acc,QString sen,QString TcpIp);
    void initComPort();
    QTimer * heartbeat_timer_;    //HeartBeat
    QTimer * senddata_timer_;     //
};

#endif // CONFIGFORM_H
